<%@ page language="java" import="com.demo.util.Conn" pageEncoding="UTF-8"%>
<%
String uname = request.getParameter("uname");
String usex = request.getParameter("usex");
String ubirthday = request.getParameter("ubirthday");
String uaddress = request.getParameter("uaddress");
String upostcode = request.getParameter("upostcode");
String uphone = request.getParameter("uphone");
String uemail = request.getParameter("uemail");
String ujobtarget = request.getParameter("ujobtarget");
String euniversity = request.getParameter("euniversity");
String elos = request.getParameter("elos");
String esd = request.getParameter("esd");
String eed = request.getParameter("eed");
String edegree = request.getParameter("edegree");
String bcompany = request.getParameter("bcompany");
String blow = request.getParameter("blow");
String bstartdate = request.getParameter("bstartdate");
String benddate = request.getParameter("benddate");
String bph = request.getParameter("bph");
String bdepartment = request.getParameter("bdepartment");
String bra = request.getParameter("bra");
String ptitle = request.getParameter("ptitle");
String pawardedby = request.getParameter("pawardedby");
String plor = request.getParameter("plor");
String pyo = request.getParameter("pyo");
String award = request.getParameter("award");
String ahost = request.getParameter("ahost");
String alocation = request.getParameter("alocation");
String ayb = request.getParameter("ayb");
String llanguage = request.getParameter("llanguage");
String lsp = request.getParameter("lsp");
String lwp = request.getParameter("lwp");
String cp = request.getParameter("cp");
String ccs = request.getParameter("ccs");
String user_id = session.getAttribute("user_id").toString();

String sql = "update dbf_stuuser set name='" + uname + "',"
			+ "sex='" + usex + "',"
			+ "birthday='" + ubirthday + "',"
			+ "address='" + uaddress + "',"
			+ "postcode='" + upostcode + "',"
			+ "contact_phone='" + uphone + "',"
			+ "email='" + uemail + "',"
			+ "job_target='" + ujobtarget + "' where STUUSER_ID=" + user_id;
Conn conn = new Conn();
conn.update(sql);

sql = "delete from dbf_education_background where STUUSER_ID=" + user_id;
conn.execute(sql);
sql = "insert into dbf_education_background(university,locationofstudy,startdate,enddate,degree,STUUSER_ID) values('"
			+ euniversity + "','"
			+ elos + "','"
			+ esd + "','"
			+ eed + "','"
			+ edegree + "',"
			+ user_id + ")";
conn.execute(sql);

sql = "delete from dbf_businessexperience where STUUSER_ID=" + user_id;
conn.execute(sql);
sql = "insert into dbf_businessexperience(companyname,LocationOfWork,startdate,enddate,PositionHeld,department,responandachi,STUUSER_ID) values('"
			+ bcompany + "','"
			+ blow + "','"
			+ bstartdate + "','"
			+ benddate + "','"
			+ bph + "','"
			+ bdepartment + "','"
			+ bra + "',"
			+ user_id + ")";
conn.execute(sql);

sql = "delete from dbf_proqua where STUUSER_ID=" + user_id;
conn.execute(sql);
sql = "insert into dbf_proqua(title,AwardedBy,LocationOfReceipt,YearObtained,STUUSER_ID) values('"
			+ ptitle + "','"
			+ pawardedby + "','"
			+ plor + "','"
			+ pyo + "',"
			+ user_id + ")";
conn.execute(sql);

sql = "delete from dbf_awards where STUUSER_ID=" + user_id;
conn.execute(sql);
sql = "insert into dbf_awards(Award,host,location,YearObtained,STUUSER_ID) values('"
			+ award + "','"
			+ ahost + "','"
			+ alocation + "','"
			+ ayb + "',"
			+ user_id + ")";
conn.execute(sql);

sql = "delete from dfb_languageskills where STUUSER_ID=" + user_id;
conn.execute(sql);
sql = "insert into dfb_languageskills(Language,SpokenProficiency,WrittenProficiency,STUUSER_ID) values('"
			+ llanguage + "','"
			+ lsp + "','"
			+ lwp + "',"
			+ user_id + ")";
conn.execute(sql);

sql = "delete from dfb_computerskills where STUUSER_ID=" + user_id;
conn.execute(sql);
sql = "insert into dfb_computerskills(Proficiency,ComputerSkills,STUUSER_ID) values('"
			+ cp + "','"
			+ ccs + "',"
			+ user_id + ")";
conn.execute(sql);

response.sendRedirect("right.jsp");
%>